/*
* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 ("License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/MPL-1.1.html
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
* the License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is: CalemEAM MicroLocale Test Suite.
*
* The Initial Developer of the Original Code is CalemEAM Inc.
* Portions created by CalemEAM are Copyright (C) 2008 CalemEAM Inc.
* All Rights Reserved.
*
* Contributor(s):
*
* ***** END LICENSE BLOCK *****
*/

package test.calemeam.text;

import j2meunit.framework.TestCase;
import j2meunit.framework.TestMethod;
import java.util.Calendar;
import java.util.Date;



/**
 * Date test helper base class
 * @author cli
 */
public class DateTestCase extends TestCase {
   protected Calendar calParse;
   
   public DateTestCase() {
	}
   
   public DateTestCase(String sTestName, TestMethod rTestMethod) {
		super(sTestName, rTestMethod);
	}
   
   protected void dateEquals(Date dt, int year, int month, int day) {
      calParse.setTime(dt);
      assertTrue(calParse.get(Calendar.YEAR)==year);
      assertTrue(calParse.get(Calendar.MONTH)==month);
      assertTrue(calParse.get(Calendar.DATE)==day);
   }
   
   protected void timeEquals(Date dt, int hour, int min, int sec) {
      calParse.setTime(dt);
      assertTrue(calParse.get(Calendar.HOUR_OF_DAY)==hour);
      assertTrue(calParse.get(Calendar.MINUTE)==min);
      assertTrue(sec>0 ? calParse.get(Calendar.SECOND)==sec : true);
   }
    
}
